import request from '@/utils/request'

// 查询专题列表
export function getPage(query) {
  return request({
    url: '/tennis/club/list',
    method: 'get',
    params: query
  })
}

// 查询专题详细
export function getObj(id) {
  return request({
    url: '/tennis/club/' + id,
    method: 'get'
  })
}

// 新增专题
export function addObj(data) {
  return request({
    url: '/tennis/club',
    method: 'post',
    data: data
  })
}

// 修改专题
export function putObj(data) {
  return request({
    url: '/tennis/club',
    method: 'put',
    data: data
  })
}

export function getAllCoach(query) {
  return request({
    url: '/tennis/coach/allList',
    method: 'get',
    params: query
  })
}
export function bindCoach(coachId,clubId) {
  return request({
    url: '/tennis/club/bindCoach',
    method: 'get',
    params: {coachId:coachId,clubId:clubId}
  })
}
export function cancelCoach(coachId,clubId) {
  return request({
    url: '/tennis/club/cancelCoach',
    method: 'get',
    params: {coachId:coachId,clubId:clubId}
  })
}
export function coachByClubid(id) {
  return request({
    url: '/tennis/coach/clubList',
    method: 'get',
    params: {clubId:id}
  })
}
// 删除专题
export function delObj(id) {
  return request({
    url: '/tennis/club/' + id,
    method: 'delete'
  })
}

// 导出专题
export function exportclub(query) {
  return request({
    url: '/tennis/club/export',
    method: 'get',
    params: query
  })
}
